3.209 \(\int (a \cos (e+f x))^m (B \cos (e+f x)+C \cos ^2(e+f x)) \, dx\)

Optimal. Leaf size=141 \[ -\frac {C \sin (e+f x) (a \cos (e+f x))^{m+3} \, _2F_1\left (\frac {1}{2},\frac {m+3}{2};\frac {m+5}{2};\cos ^2(e+f x)\right )}{a^3 f (m+3) \sqrt {\sin ^2(e+f x)}}-\frac {B \sin (e+f x) (a \cos (e+f x))^{m+2} \, _2F_1\left (\frac {1}{2},\frac {m+2}{2};\frac {m+4}{2};\cos ^2(e+f x)\right )}{a^2 f (m+2) \sqrt {\sin ^2(e+f x)}} \]

[Out]

-B*(a*cos(f*x+e))^(2+m)*hypergeom([1/2, 1+1/2*m],[2+1/2*m],cos(f*x+e)^2)*sin(f*x+e)/a^2/f/(2+m)/(sin(f*x+e)^2)
^(1/2)-C*(a*cos(f*x+e))^(3+m)*hypergeom([1/2, 3/2+1/2*m],[5/2+1/2*m],cos(f*x+e)^2)*sin(f*x+e)/a^3/f/(3+m)/(sin
(f*x+e)^2)^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.14, antiderivative size = 141, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {3010, 2748, 2643} \[ -\frac {B \sin (e+f x) (a \cos (e+f x))^{m+2} \, _2F_1\left (\frac {1}{2},\frac {m+2}{2};\frac {m+4}{2};\cos ^2(e+f x)\right )}{a^2 f (m+2) \sqrt {\sin ^2(e+f x)}}-\frac {C \sin (e+f x) (a \cos (e+f x))^{m+3} \, _2F_1\left (\frac {1}{2},\frac {m+3}{2};\frac {m+5}{2};\cos ^2(e+f x)\right )}{a^3 f (m+3) \sqrt {\sin ^2(e+f x)}} \]

Antiderivative was successfully verified.

[In]

Int[(a*Cos[e + f*x])^m*(B*Cos[e + f*x] + C*Cos[e + f*x]^2),x]

[Out]

-((B*(a*Cos[e + f*x])^(2 + m)*Hypergeometric2F1[1/2, (2 + m)/2, (4 + m)/2, Cos[e + f*x]^2]*Sin[e + f*x])/(a^2*
f*(2 + m)*Sqrt[Sin[e + f*x]^2])) - (C*(a*Cos[e + f*x])^(3 + m)*Hypergeometric2F1[1/2, (3 + m)/2, (5 + m)/2, Co
s[e + f*x]^2]*Sin[e + f*x])/(a^3*f*(3 + m)*Sqrt[Sin[e + f*x]^2])

Rule 2643

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(Cos[c + d*x]*(b*Sin[c + d*x])^(n + 1)*Hypergeomet
ric2F1[1/2, (n + 1)/2, (n + 3)/2, Sin[c + d*x]^2])/(b*d*(n + 1)*Sqrt[Cos[c + d*x]^2]), x] /; FreeQ[{b, c, d, n
}, x] &&  !IntegerQ[2*n]

Rule 2748

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[c, Int[(b*S
in[e + f*x])^m, x], x] + Dist[d/b, Int[(b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x]

Rule 3010

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x
_Symbol] :> Dist[1/b, Int[(b*Sin[e + f*x])^(m + 1)*(B + C*Sin[e + f*x]), x], x] /; FreeQ[{b, e, f, B, C, m}, x
]

Rubi steps

\begin {align*} \int (a \cos (e+f x))^m \left (B \cos (e+f x)+C \cos ^2(e+f x)\right ) \, dx &=\frac {\int (a \cos (e+f x))^{1+m} (B+C \cos (e+f x)) \, dx}{a}\\ &=\frac {B \int (a \cos (e+f x))^{1+m} \, dx}{a}+\frac {C \int (a \cos (e+f x))^{2+m} \, dx}{a^2}\\ &=-\frac {B (a \cos (e+f x))^{2+m} \, _2F_1\left (\frac {1}{2},\frac {2+m}{2};\frac {4+m}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{a^2 f (2+m) \sqrt {\sin ^2(e+f x)}}-\frac {C (a \cos (e+f x))^{3+m} \, _2F_1\left (\frac {1}{2},\frac {3+m}{2};\frac {5+m}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{a^3 f (3+m) \sqrt {\sin ^2(e+f x)}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.26, size = 118, normalized size = 0.84 \[ -\frac {\sqrt {\sin ^2(e+f x)} \cos (e+f x) \cot (e+f x) (a \cos (e+f x))^m \left (B (m+3) \, _2F_1\left (\frac {1}{2},\frac {m+2}{2};\frac {m+4}{2};\cos ^2(e+f x)\right )+C (m+2) \cos (e+f x) \, _2F_1\left (\frac {1}{2},\frac {m+3}{2};\frac {m+5}{2};\cos ^2(e+f x)\right )\right )}{f (m+2) (m+3)} \]

Antiderivative was successfully verified.

[In]

Integrate[(a*Cos[e + f*x])^m*(B*Cos[e + f*x] + C*Cos[e + f*x]^2),x]

[Out]

-((Cos[e + f*x]*(a*Cos[e + f*x])^m*Cot[e + f*x]*(B*(3 + m)*Hypergeometric2F1[1/2, (2 + m)/2, (4 + m)/2, Cos[e
+ f*x]^2] + C*(2 + m)*Cos[e + f*x]*Hypergeometric2F1[1/2, (3 + m)/2, (5 + m)/2, Cos[e + f*x]^2])*Sqrt[Sin[e +
f*x]^2])/(f*(2 + m)*(3 + m)))

________________________________________________________________________________________

fricas [F]  time = 0.46, size = 0, normalized size = 0.00 \[ {\rm integral}\left ({\left (C \cos \left (f x + e\right )^{2} + B \cos \left (f x + e\right )\right )} \left (a \cos \left (f x + e\right )\right )^{m}, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*cos(f*x+e))^m*(B*cos(f*x+e)+C*cos(f*x+e)^2),x, algorithm="fricas")

[Out]

integral((C*cos(f*x + e)^2 + B*cos(f*x + e))*(a*cos(f*x + e))^m, x)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (C \cos \left (f x + e\right )^{2} + B \cos \left (f x + e\right )\right )} \left (a \cos \left (f x + e\right )\right )^{m}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*cos(f*x+e))^m*(B*cos(f*x+e)+C*cos(f*x+e)^2),x, algorithm="giac")

[Out]

integrate((C*cos(f*x + e)^2 + B*cos(f*x + e))*(a*cos(f*x + e))^m, x)

________________________________________________________________________________________

maple [F]  time = 1.38, size = 0, normalized size = 0.00 \[ \int \left (a \cos \left (f x +e \right )\right )^{m} \left (B \cos \left (f x +e \right )+C \left (\cos ^{2}\left (f x +e \right )\right )\right )\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a*cos(f*x+e))^m*(B*cos(f*x+e)+C*cos(f*x+e)^2),x)

[Out]

int((a*cos(f*x+e))^m*(B*cos(f*x+e)+C*cos(f*x+e)^2),x)

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (C \cos \left (f x + e\right )^{2} + B \cos \left (f x + e\right )\right )} \left (a \cos \left (f x + e\right )\right )^{m}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*cos(f*x+e))^m*(B*cos(f*x+e)+C*cos(f*x+e)^2),x, algorithm="maxima")

[Out]

integrate((C*cos(f*x + e)^2 + B*cos(f*x + e))*(a*cos(f*x + e))^m, x)

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.01 \[ \int {\left (a\,\cos \left (e+f\,x\right )\right )}^m\,\left (C\,{\cos \left (e+f\,x\right )}^2+B\,\cos \left (e+f\,x\right )\right ) \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a*cos(e + f*x))^m*(B*cos(e + f*x) + C*cos(e + f*x)^2),x)

[Out]

int((a*cos(e + f*x))^m*(B*cos(e + f*x) + C*cos(e + f*x)^2), x)

________________________________________________________________________________________

sympy [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*cos(f*x+e))**m*(B*cos(f*x+e)+C*cos(f*x+e)**2),x)

[Out]

Timed out

________________________________________________________________________________________